import request from '@/utils/request'
import id from 'element-ui/src/locale/lang/id'

export function getList(paykey) {
  return request({
    url: '/cvsm/video/pagination',
    method: 'get',
    params: paykey,
  })
}

export function doDelete(data) {
  return request({
    url: '/cvsm/video',
    method: 'delete',
    data,
  })
}
// 固定切分
export function doCut(data) {
  return request({
    url: '/cvsm/video/fix/segmentation',
    method: 'post',
    data,
  })
}

export function getdetail(id) {
  return request({
    url: '/cvsm/video/' + id,
    method: 'get',
  })
}
//自由切分
export function customcut(key) {
  let id = key.id
  let data = {
    startTime: '',
    endTime: '',
  }
  data.startTime = key.startTime
  data.endTime = key.endTime
  return request({
    url: '/cvsm/video/flexible/segmentation/' + id,
    method: 'post',
    data,
  })
}

// 视频合并
export function videomerge(id) {
  return request({
    url: '/cvsm/video/clip/merge/' + id,
    method: 'post',
  })
}

// 语言提取
export function audioextract(data) {
  return request({
    url: '/cvsm/video/speech/extract',
    method: 'post',
    data,
  })
}

// 语音视频合成
export function audiomerge(data) {
  return request({
    url: '/cvsm/video/speech/composite',
    method: 'post',
    data,
  })
}

// 语音转文本
export function aToText(id) {
  return request({
    url: '/cvsm/video/speech/to/text/' + id,
    method: 'post',
  })
}

// 文本转语音
export function tToAudio(paykey, id) {
  return request({
    url: '/cvsm/video/text/to/speech/' + id,
    method: 'post',
    params: paykey,
  })
}
// 录音合成页查询视频片段
export function getdialoglist(paykey, id) {
  return request({
    url: '/cvsm/video/clip/pagination/' + id,
    method: 'get',
    params: paykey,
  })
}
